package truedano.truedano;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;

public class MyDatePicker extends Activity {
	private DatePicker datePicker1;
	private Button show;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.my_date_picker);
		setView();
		setListener();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.my_date_picker, menu);
		return true;
	}
	
	private void setView() {
		datePicker1 = (DatePicker)findViewById(R.id.datePicker1);
		show = (Button)findViewById(R.id.show);
	}
	
	private void setListener() {
		show.setOnClickListener(new Button.OnClickListener(){

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				String str="";
				//str.format("getDayOfMonth"+datePicker1.getDayOfMonth());
				str = datePicker1.toString();
				//Log.i("truedano",""+str);
				setTitle(str);
			}
			
		});
	}

}
